package com.ruoyi.purchase.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.purchase.mapper.TPurchaseOrderMapper;
import com.ruoyi.purchase.domain.TPurchaseOrder;
import com.ruoyi.purchase.service.ITPurchaseOrderService;

/**
 * 采购单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-24
 */
@Service
public class TPurchaseOrderServiceImpl implements ITPurchaseOrderService 
{
    @Autowired
    private TPurchaseOrderMapper tPurchaseOrderMapper;

    /**
     * 查询采购单
     * 
     * @param poNo 采购单主键
     * @return 采购单
     */
    @Override
    public TPurchaseOrder selectTPurchaseOrderByPoNo(String poNo)
    {
        return tPurchaseOrderMapper.selectTPurchaseOrderByPoNo(poNo);
    }

    /**
     * 查询采购单列表
     * 
     * @param tPurchaseOrder 采购单
     * @return 采购单
     */
    @Override
    public List<TPurchaseOrder> selectTPurchaseOrderList(TPurchaseOrder tPurchaseOrder)
    {
        return tPurchaseOrderMapper.selectTPurchaseOrderList(tPurchaseOrder);
    }

    /**
     * 新增采购单
     * 
     * @param tPurchaseOrder 采购单
     * @return 结果
     */
    @Override
    public int insertTPurchaseOrder(TPurchaseOrder tPurchaseOrder)
    {
        return tPurchaseOrderMapper.insertTPurchaseOrder(tPurchaseOrder);
    }

    /**
     * 修改采购单
     * 
     * @param tPurchaseOrder 采购单
     * @return 结果
     */
    @Override
    public int updateTPurchaseOrder(TPurchaseOrder tPurchaseOrder)
    {
        return tPurchaseOrderMapper.updateTPurchaseOrder(tPurchaseOrder);
    }

    /**
     * 批量删除采购单
     * 
     * @param poNos 需要删除的采购单主键
     * @return 结果
     */
    @Override
    public int deleteTPurchaseOrderByPoNos(String[] poNos)
    {
        return tPurchaseOrderMapper.deleteTPurchaseOrderByPoNos(poNos);
    }

    /**
     * 删除采购单信息
     * 
     * @param poNo 采购单主键
     * @return 结果
     */
    @Override
    public int deleteTPurchaseOrderByPoNo(String poNo)
    {
        return tPurchaseOrderMapper.deleteTPurchaseOrderByPoNo(poNo);
    }
}